<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<spring:message var="pageTitle" code="ajouterUtilisateur.pageTitle" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>${pageTitle}</title>
</head>
<body>
	<div id="gestionUtilisateurs">
		<h2>Liste des utilisateurs en attente de validation</h2>
		<c:choose>
			<c:when test="${nbUsers == 0}">
				<div id="msgAlternatif">
					Il n'y a aucun utilisateur à valider.
				</div>
			</c:when>
			<c:otherwise>
				<table class="table-curved">
						<thead>
							<tr>
								<th class="idItem">id</th>
								<th class="labelItem">Prénom Nom</th>
								<th class="actionItem">actions</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="user" items="${listUsers}">
								<tr>
									<td>${user.idUser}</td>
									<td><div class="previewUser">
											${user.firstName} ${user.lastName}
											<div class="previewInfosUser">
												<div class="positionnemntPreview">
													<c:if test="${user.srcAvatar != null}">
													</c:if>
													<c:choose>
														<c:when test="${user.srcAvatar != null}">
															<img id="IRImg"
															src="${pageContext.request.contextPath}/resources/upload/user/avatar/${user.srcAvatar}" />
														</c:when>
														<c:otherwise>
															<img id="IRImg"
															src="${pageContext.request.contextPath}/resources/img/no_avatar.jpg" />
														</c:otherwise>
													</c:choose>
													<%@  include file="/resources/includes/previewUser.jspf"%>
												</div>
											</div>
										</div></td>
									<td>					
						           <div class="btnAction multiButton"> <a href="<c:url value="/admin/utilisateur/valider/${user.idUser}">
			        				</c:url>">Valider</a></div>
						           <div class="btnAction multiButton"> <a href="<c:url value="/admin/utilisateur/delete/${user.idUser}">
			        				</c:url>">Supprimer</a></div>        				
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
			</c:otherwise>
		</c:choose>		
	
	</div>
</body>
</html>